//////////////////////////////////////////////
// File				:	Mouse.h
//
// Author			:	Nick Faletra (NF)
//
// Date Created		:	12/22/2013
//////////////////////////////////////////////
#ifndef _MOUSE_H_
#define _MOUSE_H_

#include "InputDevice.h"

class CMouse : public CInputDevice
{
	DIMOUSESTATE2 m_diMouseState;
	DIMOUSESTATE2 m_diPrevMouseState;

	int m_nNumButtons;
	int m_nPosX;
	int m_nPosY;

public:
	CMouse(IDirectInput8* pDI, HWND hWnd, bool bExclusive = false);

	bool ReadDevice();
	bool ReadBufferedDevice();

	bool ButtonDown(unsigned char ucButton);
	bool ButtonPressed(unsigned char ucButton);
	bool ButtonPressedEx(unsigned char ucButton);
	bool ButtonUp(unsigned char ucButton);
	bool ButtonReleased(unsigned char ucButton);
	bool ButtonReleasedEx(unsigned char ucButton);

	int CheckBufferedButtons();
	int CheckBufferedButtonsEx();

	long MovementX();
	long MovementY();
	long WheelMovement();

	__forceinline int GetNumButtons() const { return m_nNumButtons; }
	__forceinline int GetPosX() const { return m_nPosX; }
	__forceinline int GetPosY() const { return m_nPosY; }

	__forceinline void SetPosX(const int nPosX) { m_nPosX = nPosX; }
	__forceinline void SetPosY(const int nPosY) { m_nPosY = nPosY; }
};

#endif // _MOUSE_H_